//
//  SEPrescriptionRejectedCell.swift
//  SmartEyeForDoctor
//
//  Created by QDSG on 2021/4/21.
//

import UIKit

class SEPrescriptionRejectedCell: UITableViewCell {
    
    override func setHighlighted(_ highlighted: Bool, animated: Bool) {
        super.setHighlighted(highlighted, animated: animated)
        containerView.backgroundColor = highlighted ? Asset.clickHighlight.color : Asset.white.color
    }
    
    func update(with viewModel: SEPrescriptionViewModel) {
        nameLabel.text = viewModel.prescription.patientName
        ageLabel.text = viewModel.patientAge
        sexImageView.image = viewModel.patientSexImage
        diagnosisLabel.text = viewModel.diagnosisResult
        reasonLabel.text = viewModel.prescription.reject
    }
    
    @IBOutlet private weak var containerView: UIView! {
        didSet {
            containerView.setLayerCorners(rect: containerView.bounds, radius: 6)
            containerView.setShadow()
        }
    }
    @IBOutlet private weak var nameLabel: UILabel!
    @IBOutlet private weak var ageLabel: UILabel!
    @IBOutlet private weak var diagnosisLabel: UILabel!
    @IBOutlet private weak var reasonLabel: UILabel!
    @IBOutlet private weak var sexImageView: UIImageView!
    
}
